package com.ruoyi.app.controller.common.controller;


import com.ruoyi.app.framework.base.BaseAppController;
import com.ruoyi.app.controller.common.service.IDistrictsService;
import com.ruoyi.common.annotation.PassToken;
import com.ruoyi.common.core.page.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/districts")
@Api(value = "地址", description = "地址列表（三级）")
public class DistrictsController extends BaseAppController {

    @Autowired
    private IDistrictsService districtsService;

    @ApiOperation(value = "获取地址列表", notes = "获取地址列表")
    @ApiResponses({
            @ApiResponse(code = 200, message = "操作成功！"),
    })
    @PassToken
    @GetMapping("/searchList")
    public TableDataInfo searchList() {
        return getDataTable(districtsService.listDistricts());
    }
}
